import Taro, { Component, Config } from '@tarojs/taro'
import Index from './pages/Index/Index'

import './app.scss'
import { View } from '@tarojs/components'


// 如果需要在 h5 环境中开启 React Devtools
// 取消以下注释：
// if (process.env.NODE_ENV !== 'production' && process.env.TARO_ENV === 'h5')  {
//   require('nerv-devtools')
// }

class App extends Component {

  /**
   * 指定config的类型声明为: Taro.Config
   *
   * 由于 typescript 对于 object 类型推导只能推出 Key 的基本类型
   * 对于像 navigationBarTextStyle: 'black' 这样的推导出的类型是 string
   * 提示和声明 navigationBarTextStyle: 'black' | 'white' 类型冲突, 需要显示声明类型
   */
  config: Config = {
    pages: [
      'pages/Index/Index',
      'pages/User/User',
      'pages/Collage/Collage',
      'pages/Search/Search',
      'pages/ProductDetails/Details',
      'pages/Order/Order',
      'pages/Profit/Profit',
    ],
    window: {
      backgroundTextStyle: 'light',
      navigationBarBackgroundColor: '#f4f4f4',
      navigationBarTitleText: '折草',
      navigationBarTextStyle: 'black',
    },
    tabBar: {
      color: "#707070",
      selectedColor: "#d81e06",
      borderStyle: 'white',
      list: [
        {
          pagePath: "pages/Index/Index",
          text: "首页",
          iconPath: 'pages/images/Home.png',
          selectedIconPath: 'pages/images/Home-active.png'
        },
        // {
        //   pagePath: "pages/Vip/Vip",
        //   text: "vip",
        //   iconPath: 'pages/images/huiyuan.png',
        //   selectedIconPath: 'pages/images/huiyuan-active.png'
        // },
        {
          pagePath: "pages/Collage/Collage",
          text: "学院",
          iconPath: 'pages/images/aixin.png',
          selectedIconPath: 'pages/images/aixin-active.png'
        },

        {
          pagePath: "pages/User/User",
          text: "我的",
          iconPath: 'pages/images/my.png',
          selectedIconPath: 'pages/images/my-active.png'
        },

      ]
    },
  }
  // 在 App 类中的 render() 函数没有实际作用
  // 请勿修改此函数
  render() {
    return (
      <View>
        <Index/>
      </View>
    )
  }
}

Taro.render(<App />, document.getElementById('app'))
